package com.miniapp.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.miniapp.entity.enums.UserStatus;
import com.miniapp.entity.enums.UserType;
import com.miniapp.validator.group.AddGroup;
import com.miniapp.validator.group.UpdateGroup;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;


import java.math.BigDecimal;
import java.util.List;

/**
 * 系统用户
 * 
 * @author linyuchi
 * @since 1.0.0 2018-03-18
 */
@SuppressWarnings("serial")
@TableName("mini_user")
public class MiniUserEntity extends BaseEntity {

	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String username;

	/**
	 * name
	 */
	private String name;

	/**
	 * 密码
	 */
	@NotBlank(message="密码不能为空", groups ={AddGroup.class})
	private String password;

	/**
	 * 盐
	 */
	private String salt;

	/**
	 * 邮箱
	 */
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	private String email;

	/**
	 * 手机号
	 */
	private String mobile;

	/**
	 * 状态  0：禁用   1：正常
	 */
	private UserStatus status;
	

	/**
	 *
	 */
	private Long createUserId;


	/**
	 *余额
	 */
	private BigDecimal balance;

	/**
	 * 加密
	 */
	private String balanceEncrypt;

	/**
	 *总消费金额
	 */
	private BigDecimal total;

	/**
	 *折扣
	 */
	private BigDecimal rebate;

	/**
	 *所属代理用户
	 */
	private Long parentUserId;


	/**
	 * 用户类型
	 *
	 */
	private String userType;

	/**
	 * 登陆日志
	 *
	 */
	@TableField(exist = false)
	private List<MiniUserLoginLogEntity> miniUserLoginLogList;

	/**
	 * 角色列表
	 */
	@TableField(exist = false)
	private List<Long> roleIdList;


	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public UserStatus getStatus() {
		return status;
	}

	public void setStatus(UserStatus status) {
		this.status = status;
	}


	public Long getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(Long createUserId) {
		this.createUserId = createUserId;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public String getBalanceEncrypt() {
		return balanceEncrypt;
	}

	public void setBalanceEncrypt(String balanceEncrypt) {
		this.balanceEncrypt = balanceEncrypt;
	}

	public BigDecimal getTotal() {
		return total;
	}

	public void setTotal(BigDecimal total) {
		this.total = total;
	}

	public BigDecimal getRebate() {
		return rebate;
	}

	public void setRebate(BigDecimal rebate) {
		this.rebate = rebate;
	}

	public Long getParentUserId() {
		return parentUserId;
	}

	public void setParentUserId(Long parentUserId) {
		this.parentUserId = parentUserId;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public List<MiniUserLoginLogEntity> getMiniUserLoginLogList() {
		return miniUserLoginLogList;
	}

	public void setMiniUserLoginLogList(List<MiniUserLoginLogEntity> miniUserLoginLogList) {
		this.miniUserLoginLogList = miniUserLoginLogList;
	}

	public List<Long> getRoleIdList() {
		return roleIdList;
	}

	public void setRoleIdList(List<Long> roleIdList) {
		this.roleIdList = roleIdList;
	}
}
